﻿using NPOI.SS.UserModel;
using System;
using System.Collections.Generic;

namespace Star.Tools.Excel
{
    public class ExcelModel { }

    /// <summary>
    /// 合并单元格实体
    /// </summary>
    public class MergedRegionInfo
    {
        public MergedRegionInfo(int index, int firstRow, int lastRow, int firstCol, int lastCol)
        {
            Index = index;
            FirstRow = firstRow;
            LastRow = lastRow;
            FirstCol = firstCol;
            LastCol = lastCol;
        }
        public MergedRegionInfo(int firstRow, int lastRow, int firstCol, int lastCol)
        {
            FirstRow = firstRow;
            LastRow = lastRow;
            FirstCol = firstCol;
            LastCol = lastCol;
        }
        public int Index { get; set; }

        /// <summary>
        /// 起始行
        /// </summary>
        public int FirstRow { get; set; }

        /// <summary>
        /// 结束行
        /// </summary>
        public int LastRow { get; set; }

        /// <summary>
        /// 起始列
        /// </summary>
        public int FirstCol { get; set; }

        /// <summary>
        /// 结束列
        /// </summary>
        public int LastCol { get; set; }
    }

    /// <summary>
    /// 单元格跨度信息
    /// </summary>
    public struct CellSpan
    {
        private int _colSpan;
        private int _rowSpan;

        public CellSpan(int rowSpan, int colSpan)
        {
            _rowSpan = rowSpan;
            _colSpan = colSpan;
        }

        public int RowSpan
        {
            get { return _rowSpan; }
            set { _rowSpan = value; }
        }

        public int ColSpan
        {
            get { return _colSpan; }
            set { _colSpan = value; }
        }
    }

    /// <summary>
    /// 图片信息
    /// </summary>
    public class PictureInfo
    {
        public PictureInfo(int minRow, int maxRow, int minCol, int maxCol, Byte[] pictureData, PictureStyle pictureStyle)
        {
            MinRow = minRow;
            MaxRow = maxRow;
            MinCol = minCol;
            MaxCol = maxCol;
            PictureData = pictureData;
            PicturesStyle = pictureStyle;
        }

        public int MinRow { get; set; }
        public int MaxRow { get; set; }
        public int MinCol { get; set; }
        public int MaxCol { get; set; }
        public Byte[] PictureData { get; set; }
        public PictureStyle PicturesStyle { get; set; }
    }

    /// <summary>
    /// 图片样式
    /// </summary>
    public class PictureStyle
    {
        public int AnchorDx1 { get; set; }
        public int AnchorDx2 { get; set; }
        public int AnchorDy1 { get; set; }
        public int AnchorDy2 { get; set; }

        public int FillColor { get; set; }
        public bool IsNoFill { get; set; }
        public LineStyle LineStyle { get; set; }
        public int LineStyleColor { get; set; }
        public double LineWidth { get; set; }
    }
}